package persistence;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.logging.Level;
import java.util.logging.Logger;


public class DB {
    private static final String login = "root";
    private static final String motdepasse = "";
    private static final String serveur = "localhost";
    private static final String bdd = "musicmap";
    private static final String pilote = "com.mysql.jdbc.Driver";

    private DB() {}

    public static Connection getConnection(){
        try {
            Class.forName(pilote);
            return DriverManager.getConnection("jdbc:mysql://"+serveur+"/"+bdd,login,motdepasse);
        }catch(Exception ex){
            Logger.getLogger(DB.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
}
